﻿using System.Windows.Controls;
using System.Windows.Data;

namespace Red.Controls.DataDriven
{
    /// <summary>
    ///     Data-aware button
    /// </summary>
    [ InteropControl( "Action" )]
    public class DataButton : Button
    {
        public DataButton()
        {
            SetBinding( ContentProperty, new Binding( "Value" )
            {
                Mode = BindingMode.OneWay,
            } );

            SetBinding( CommandParameterProperty, new Binding( "ActionParameter" ) );
            SetBinding( CommandProperty, new Binding( "Action" ) );
        }
    }
}
